package net.entelijan.cobean.core.impl;

import java.util.List;

import net.entelijan.cobean.core.IMultiSelectionListCobean;

public abstract class AbstractBoundPropertyMultiSelectionComponentBean<T>
		extends AbstractComponentBean implements
		IMultiSelectionListCobean<T> {

	public AbstractBoundPropertyMultiSelectionComponentBean() {
		super();
	}

	@Override
	public void setValue(List<T> data) {
		List<T> oldValue = getValue();
		setDataPlain(data);
		propertyChangeSupport.firePropertyChange("value", oldValue, data);
	}

	protected abstract void setDataPlain(List<T> data);

	@Override
	public void setSelectedValue(List<T> data) {
		List<T> oldValue = getSelectedValue();
		setSelectedDataPlain(data);
		propertyChangeSupport
				.firePropertyChange("selectedValue", oldValue, data);
	}

	protected abstract void setSelectedDataPlain(List<T> data);

}
